package com.zhongkun.datahome.service.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongkun.datahome.service.domain.HouseAssetsRelation;
import com.zhongkun.datahome.service.mapper.HouseAssetsRelationMapper;
import org.springframework.stereotype.Repository;

/**
 * @Author: lifengsheng
 * @Date: 2025/4/14 17:15
 * @Desc
 */
@Repository
public class HouseAssetsRelationRepository extends ServiceImpl<HouseAssetsRelationMapper, HouseAssetsRelation> {
    public void removeByAssetsId(Long assetsId) {
        this.remove(new LambdaQueryWrapper<HouseAssetsRelation>()
                .eq(HouseAssetsRelation::getAssetsId, assetsId));
    }

    public void removeBy(Long houseId, Long assetsId) {
        this.remove(new LambdaQueryWrapper<HouseAssetsRelation>()
                .eq(HouseAssetsRelation::getHouseId, houseId)
                .eq(HouseAssetsRelation::getAssetsId, assetsId));
    }
}
